import { Module } from 'vuex'
import { ACCOUNT } from './interface'
import * as Types from './types'
/**
 * 账号相关信息
 */
const state: Record<string, any> = {
  enterpriseId: '',
  departmentId: '',
  openId: '',
  openShortId: '',
  userName: '',
  roleId: '',
  accessToken: '',
  smallTenancyStatus: ''
}

const login: Module<ACCOUNT, any> = {
  namespaced: true,
  state: state as any,
  mutations: {
    async [Types.SET_ACCOUNT_DATA](state, data) {
      Object.assign(state, data)
    },
  }
}

export default login
